import { lazy } from "react"
import {
  AppOutline,
  AppstoreOutline,
  MessageFill,
  UserOutline,
} from "antd-mobile-icons"
// 导入路由
const Layout = lazy(() => import("../page/Layout"))
const Login = lazy(() => import("../page/Login"))
const Home = lazy(() => import("../page/Home"))
const Message = lazy(() => import("../page/Message"))
const Class = lazy(() => import("../page/Class"))
const User = lazy(() => import("../page/User"))
const List = lazy(() => import("../page/List"))
const SelecPrson = lazy(() => import("../page/SelectPerson"))
const Notfound = lazy(() => import("../page/Error"))
// 搭建子级路由
export const childrenRouter = [
  {
    path: "/",
    element: <Home />,
    title: "主页",
    icon: <AppOutline />,
  },
  {
    path: "/class",
    element: <Class />,
    title: "分类",
    icon: <AppstoreOutline />,
  },
  {
    path: "/message",
    element: <Message />,
    title: "消息",
    icon: <MessageFill />,
  },
  {
    path: "/user",
    element: <User />,
    title: "我得",
    icon: <UserOutline />,
  },
]
// 搭建路由表
export const router = [
  {
    path: "/",
    element: <Layout />,
    children: childrenRouter,
  },
  {
    path: "/Login",
    element: <Login />,
  },
  {
    path: "/list",
    element: <List />,
  },
  {
    path: "/selectperson",
    element: <SelecPrson />,
  },
  {
    path: "*",
    element: <Notfound />,
  },
]
